From be6ed71c4142a004aa4cd64461d9a973a5813524 Mon Sep 17 00:00:00 2001 From: Camm Maguire Date: Thu, 16 Jul 2026 16:48:46 +0000 Subject: [PATCH] [PATCH] TODO: Put a short summary on the line above and replace this paragraph with a longer explanation of this change. Complete the meta-information with other relevant fields (see below for details). To make it easier, the information below has been extracted from the changelog. Adjust it or drop it. Gbp-Pq: Name Version_2_7_2pre36 --- Makefile.am | 5 +++- Makefile.in | 5 +++- cmpnew/gcl_cmpeval.lsp | 50 ++++++++++++++++++++++++++++++---------- cmpnew/gcl_cmptype.lsp | 3 ++- cmpnew/gcl_lfun_list.lsp | 2 ++ gcl-tk/guis.c | 2 +- gcl-tk/tkl.lisp | 19 ++++----------- git.tag | 2 +- h/386-macosx.h | 1 - h/aarch64-macosx.h | 1 - h/amd64-kfreebsd.h | 3 --- h/amd64-linux.h | 3 --- h/att_ext.h | 1 + h/loongarch64-linux.h | 3 --- h/pool.h | 1 - h/powerpc-linux.h | 1 - h/protoize.h | 2 +- h/riscv64-linux.h | 3 --- h/s390-linux.h | 1 - h/sparc-linux.h | 4 ---- o/cmpaux.c | 1 - o/disable_aslr.c | 27 +++++++++++++++------- o/file.d | 1 - o/gprof.c | 17 +++++++++++++- o/hash.d | 10 ++++---- o/main.c | 6 ++--- o/save.c | 1 + o/unixfsys.c | 15 ++---------- unixport/sys.c | 2 -- 29 files changed, 105 insertions(+), 87 deletions(-) diff --git a/Makefile.am b/Makefile.am index a95e54b1..44720f39 100644 --- a/Makefile.am +++ b/Makefile.am @@ -259,6 +259,9 @@ unixport/saved_%: | unixport/raw_% unixport/gcl_cmpnopt_%.lsp \ ( ! echo $@ | grep -q _gprof$$ || echo "(setq compiler::*default-prof-p* t)" >prof_init.lsp ) && \ echo "(system:save-system \"../$@\")" | \ cat ../unixport/init_raw.lsp prof_init.lsp - | \ + GCL_DISABLE_ASLR=t \ + GCL_MULTIPROCESS_MEMORY_POOL= \ + GCL_MEM_BOUND=29 \ GCL_LSPSYSDIR=../$(srcdir)/unixport/ \ ../unixport/raw_$* unixport/ -libdir ./ && \ rm -f ../unixport/gcl_cmpnopt.lsp @@ -581,7 +584,7 @@ gcl-tk/%.o: gcl-tk/%.lsp | unixport/saved_ansi_gcl CLEANFILES+=gcl-tk/demos/index.lsp gcl-tk/demos/gc-monitor.o gcl-tk/demos/index.lsp: gcl-tk/tkl.o | unixport/saved_gcl [ -d $(@D) ] || mkdir -p $(@D) - cd $(@D) && echo "(load \"../../$<\")(tk::get-autoloads (directory \"*.lisp\"))" | ../../$| + cd $(@D) && echo "(load \"../../$<\")(tk::get-autoloads)" | ../../$| sb_cmpnew/gcl_collectfn.o: cmpnew/gcl_collectfn.lsp | unixport/saved_gcl [ -d $(@D) ] || mkdir -p $(@D) diff --git a/Makefile.in b/Makefile.in index 7cb6ff40..0c0f13e4 100644 --- a/Makefile.in +++ b/Makefile.in @@ -4598,6 +4598,9 @@ unixport/saved_%: | unixport/raw_% unixport/gcl_cmpnopt_%.lsp \ ( ! echo $@ | grep -q _gprof$$ || echo "(setq compiler::*default-prof-p* t)" >prof_init.lsp ) && \ echo "(system:save-system \"../$@\")" | \ cat ../unixport/init_raw.lsp prof_init.lsp - | \ + GCL_DISABLE_ASLR=t \ + GCL_MULTIPROCESS_MEMORY_POOL= \ + GCL_MEM_BOUND=29 \ GCL_LSPSYSDIR=../$(srcdir)/unixport/ \ ../unixport/raw_$* unixport/ -libdir ./ && \ rm -f ../unixport/gcl_cmpnopt.lsp @@ -4899,7 +4902,7 @@ gcl-tk/%.o: gcl-tk/%.lsp | unixport/saved_ansi_gcl $(word 1,$|) -compile $< -o $@ gcl-tk/demos/index.lsp: gcl-tk/tkl.o | unixport/saved_gcl [ -d $(@D) ] || mkdir -p $(@D) - cd $(@D) && echo "(load \"../../$<\")(tk::get-autoloads (directory \"*.lisp\"))" | ../../$| + cd $(@D) && echo "(load \"../../$<\")(tk::get-autoloads)" | ../../$| sb_cmpnew/gcl_collectfn.o: cmpnew/gcl_collectfn.lsp | unixport/saved_gcl [ -d $(@D) ] || mkdir -p $(@D) diff --git a/cmpnew/gcl_cmpeval.lsp b/cmpnew/gcl_cmpeval.lsp index 1ceffc3a..e71c456b 100644 --- a/cmpnew/gcl_cmpeval.lsp +++ b/cmpnew/gcl_cmpeval.lsp @@ -650,7 +650,7 @@ (defun lit-inl2 (form &aux (lf (eq 'lit (car form)))) (list (this-safety-level) (mapcar (lambda (x) (assert (eq (car x) 'ub)) (third x)) (when lf (fifth form))) - (cons (when lf (third form)) (info-type (cadr form))) + (cons (when lf (third form)) (ensure-known-type (info-type (cadr form)))) (ninth form) (if lf (remove-comment (fourth form)) ""))) @@ -685,12 +685,15 @@ (let ((i -1)) (mapcan (lambda (x &aux (y (incf i))) (unless (atomic-tp x) (list y))) tps)) tr))) +(defun tr-unused-tps (tr tps &aux (i -1)) + (mapcar (lambda (x) (if (member (incf i) tr) t x)) tps)) + (defun ?update-fm-propagator (fm cl tr tps) (when (symbolp (car cl)) (when (get (car cl) 'type-propagator);?more (when (eq (car fm) 'lit) (when (member-if 'integerp tr) ;otherwise no point - (push (list (car cl) tr tps) (ninth fm))))))) + (push (list (car cl) tr (tr-unused-tps tr tps)) (ninth fm))))))) (defun merge-inl (cl inl pl &aux (tps (pop inl))(tr (pop inl))) (let ((z (member-if (lambda (x) (can-coalesce x tr inl tps)) (car pl)))) @@ -705,7 +708,7 @@ (mapc (lambda (x) (merge-inl cl x pl)) inls)) (defun ?add-inl (cl fms fm) - (let* ((tps (mapcar (lambda (x) (info-type (caddr x))) fms)) + (let* ((tps (mapcar (lambda (x) (ensure-known-type (info-type (caddr x)))) fms)) (tr (mapcar (lambda (x &aux (v (car (last x)))) (when (and (consp v) (eq (car v) 'var)) (position (cddr v) fms :key 'cdddr :test 'equalp)));FIXME @@ -719,8 +722,6 @@ (si::string-concatenate "/* " (prin1-to-string form) " */" (remove-comment s)) s)) -(defvar *apply-inl-hash* t) - (defun update-info-type-from-inl (i inl fms &aux (tps (mapcar (lambda (x) (info-type (caddr x))) fms))) (setf (info-type i) (reduce 'type-and @@ -745,8 +746,14 @@ (mapc (lambda (y) (?update-fm-propagator x y tr (caddr y))) (sixth inl)))) +(defvar *block-apply-inl* nil) + +(defun block-apply-inl (cl) + (if (listp *block-apply-inl*) + (member (car cl) *block-apply-inl*) + t)) -(defun apply-inl (cl fms &aux (inl (when *apply-inl-hash* (inls-match cl fms)))) +(defun apply-inl (cl fms &aux (inl (unless (block-apply-inl cl) (inls-match cl fms)))) (when inl (let* ((c1fms (mapcar (lambda (x) (cdr (nth x fms))) (second inl)))) (unless (member-if-not (lambda (x) @@ -769,7 +776,7 @@ (defvar *ncompiles* 0) (defun try-compile (nm s tps - &aux (*sig-discovery* t) + &aux (*sig-discovery* t) si::*sig-discovery-props* *compile-verbose* (syms (mapcar (lambda (x) (declare (ignore x)) (gensym)) tps))) (incf *ncompiles*) @@ -798,7 +805,8 @@ (car inls))) (defun iterate-over-inls (nm at &optional (it 0) - &aux (inls (copy-tree (get-inl-list (list nm)))) + &aux (*block-apply-inl* (list nm)) + (inls (copy-tree (get-inl-list (list nm)))) (have-2 (member 2 (car inls) :key 'caddr))) (flet ((try (s tps chg) ;(print (list 'trying nm s (mapcar 'cmp-unnorm-tp tps))) @@ -807,6 +815,7 @@ (print (list nm s (mapcar 'cmp-unnorm-tp tps) chg)) (return-from iterate-over-inls (iterate-over-inls nm at (1+ it)))))) (mapc (lambda (inl &aux (tps (copy-list (car inl)))) + (try (caddr inl) (car inl) (list 'no-mod)) (when (eql 0 (caddr inl)) (try 1 (car inl) (list 0 '-> 1))) (mapl (lambda (ptp pstp &aux (tp (car ptp))(stp (car pstp))) @@ -830,6 +839,21 @@ (car inls)) it)) +(defun seed-all-inls (&aux r) + (declare (dynamic-extent r)) + (do-all-symbols (s) + (unless (gethash s *inl-hash*) + (when (fboundp s) + (unless (or (macro-function s) (special-operator-p s)) + (when (get-return-type s) + (unless (member s r) + (pushnew s r) + (let ((at (get-arg-types s))) + (print s) + (try-compile s 0 + (make-list (length (ldiff at (member '* at))) + :initial-element t)))))))))) + (defun finalize-inls (nm &aux (*ncompiles* 0)(at (get-arg-types nm))(inls (get-inl-list (list nm)))) (restrict-inl-1-tps nm at inls) (list (iterate-over-inls nm at) *ncompiles* (show-inls nm))) @@ -840,12 +864,14 @@ (unless (zerop (car (finalize-inls x))) (setq redo t))) *inl-hash*) - (when redo - (finalize-all-inls))) + (when redo (finalize-all-inls))) + +(defun finalize-inl-hash nil + (seed-all-inls) + (finalize-all-inls)) (defun dump-inl-hash (f &optional finalize &aux (si::*print-package* t)) - (when finalize (finalize-all-inls)) -; (when compress (maphash (lambda (x y) (declare (ignore y)) (compress-inl x)) *inl-hash*)) + (when finalize (finalize-inl-hash)) (with-open-file (s f :direction :output) (prin1 '(in-package :compiler) s) (terpri s) diff --git a/cmpnew/gcl_cmptype.lsp b/cmpnew/gcl_cmptype.lsp index b489f6a0..f14a1be4 100644 --- a/cmpnew/gcl_cmptype.lsp +++ b/cmpnew/gcl_cmptype.lsp @@ -871,7 +871,8 @@ (si::putprop 'random 'random-propagator 'type-propagator) (defun lgcd2-propagator (f t1 t2 t3 - &aux (a1 (car (atomic-tp t1)))(a2 (car (atomic-tp t2))) + &aux (t1 (type-and #tinteger t1))(t2 (type-and #tinteger t2))(t3 (type-and #tinteger t3)) + (a1 (car (atomic-tp t1)))(a2 (car (atomic-tp t2))) (a3 (car (atomic-tp t3)))) (cond ((and a1 a2 a3) (object-type (funcall f a1 a2 a3))) ((type-and #t(not (integer 0 0)) (super-range '* #t(integer 0 1) (super-range 'min t1 t2)))))) diff --git a/cmpnew/gcl_lfun_list.lsp b/cmpnew/gcl_lfun_list.lsp index 9e0aae07..2662dd08 100644 --- a/cmpnew/gcl_lfun_list.lsp +++ b/cmpnew/gcl_lfun_list.lsp @@ -18,6 +18,7 @@ ; (((t) t) . si::type-of-c) ; (((list) t) . si::cons-car) ; (((list) t) . si::cons-cdr) + (((structure) symbol) . structure-name) (((t t) cons) . cons) (((*) si::proper-list) . list) (((t *) list) . list*) @@ -33,6 +34,7 @@ (((real *) (returns-exactly real real)) . ceiling) (((real *) (returns-exactly real real)) . truncate) (((real *) (returns-exactly real real)) . round) + ((((or (integer 1) (float (0))) *) (or (integer 0) (float 0))) . random) ; (((cons t) cons) . rplaca) ; (((cons t) cons) . rplacd) ; (((symbol) boolean) . boundp) diff --git a/gcl-tk/guis.c b/gcl-tk/guis.c index 9688c680..e8b88502 100644 --- a/gcl-tk/guis.c +++ b/gcl-tk/guis.c @@ -273,7 +273,7 @@ char *envp[]; { dfprintf(stderr, "guis,vforked child : %d\n", p); - _exit(p); + _exit(0); /* return p; */ diff --git a/gcl-tk/tkl.lisp b/gcl-tk/tkl.lisp index 86d35c9a..61314e58 100644 --- a/gcl-tk/tkl.lisp +++ b/gcl-tk/tkl.lisp @@ -1487,18 +1487,15 @@ on ~a as in: ~s~%" host command ))) (setf (msg-index) (the fixnum (+ m 1))) m) -(defun get-autoloads (&optional (lis (directory "*.lisp")) ( out "index.lsp") - &aux *paths* - ) - (declare (special *paths*)) +(defun get-autoloads (&optional + (lis (sort (directory "*.lisp") 'string<= :key 'namestring)) + (out "index.lsp")) (with-open-file (st out :direction :output) (format st "~%(in-package ~s)" (package-name *package*)) (dolist (v lis) (get-file-autoloads v st)) (format st "~%(in-package ~s)" (package-name *package*)) - ;(format st "~2%~s" `(setq si::*load-path* (append ',*paths* si::*load-path*))) - - )) + (format st "~%(push (namestring (make-pathname :directory (pathname-directory *load-pathname*))) si::*load-path*)"))) @@ -1506,16 +1503,10 @@ on ~a as in: ~s~%" host command ))) &aux (eof '(nil)) (*package* *package*) saw-package - name ) - (declare (special *paths*)) + name) (setq name (pathname-name (pathname file))) (with-open-file (st file) - (if (boundp '*paths*) - (pushnew (namestring (make-pathname :directory - (pathname-directory - (truename st)))) - *paths* :test 'equal)) (sloop for tem = (read st nil eof) while (not (eq tem eof)) do (cond ((and (consp tem) (eq (car tem) 'defun)) diff --git a/git.tag b/git.tag index 80fa1659..e54678a4 100644 --- a/git.tag +++ b/git.tag @@ -1 +1 @@ -"Version_2_7_2pre35" +"Version_2_7_2pre36" diff --git a/h/386-macosx.h b/h/386-macosx.h index d977a3e5..d9f51dc6 100644 --- a/h/386-macosx.h +++ b/h/386-macosx.h @@ -115,7 +115,6 @@ do { \ } while (0) #ifdef _LP64 -#define C_GC_OFFSET 4 #include #define RELOC_H "mach64_i386_reloc.h" #else diff --git a/h/aarch64-macosx.h b/h/aarch64-macosx.h index a110d19e..eb7be4d5 100644 --- a/h/aarch64-macosx.h +++ b/h/aarch64-macosx.h @@ -114,7 +114,6 @@ do { \ (a_) = fub; \ } while (0) -#define C_GC_OFFSET 4 #include #define RELOC_H "mach64_aarch64_reloc.h" diff --git a/h/amd64-kfreebsd.h b/h/amd64-kfreebsd.h index 403ece2b..6cb35f54 100644 --- a/h/amd64-kfreebsd.h +++ b/h/amd64-kfreebsd.h @@ -8,9 +8,6 @@ #define I386 #define SGC -/* Apparently stack pointers can be 4 byte aligned, at least &argc -- CM */ -#define C_GC_OFFSET 4 - #define RELOC_H "elf64_i386_reloc.h" #define BRK_DOES_NOT_GUARANTEE_ALLOCATION diff --git a/h/amd64-linux.h b/h/amd64-linux.h index 8d71728c..4ccbfa5d 100644 --- a/h/amd64-linux.h +++ b/h/amd64-linux.h @@ -7,9 +7,6 @@ #define I386 #define SGC -/* Apparently stack pointers can be 4 byte aligned, at least &argc -- CM */ -#define C_GC_OFFSET 4 - #define RELOC_H "elf64_i386_reloc.h" #define MAX_CODE_ADDRESS (1L<<31)/*large memory model broken gcc 4.8*/ #define MAX_DEFAULT_MEMORY_MODEL_CODE_ADDRESS (1UL<<31) diff --git a/h/att_ext.h b/h/att_ext.h index 91f1cfa3..18ef2eb6 100644 --- a/h/att_ext.h +++ b/h/att_ext.h @@ -171,6 +171,7 @@ EXTER char **ARGV; #ifdef UNIX EXTER char **ENVP; #endif +EXTER struct stat ss; EXTER object sSAsystem_directoryA; #ifdef UNIX diff --git a/h/loongarch64-linux.h b/h/loongarch64-linux.h index b3745d24..aee2b6b2 100644 --- a/h/loongarch64-linux.h +++ b/h/loongarch64-linux.h @@ -2,9 +2,6 @@ #define SGC -/* Apparently stack pointers can be 4 byte aligned, at least &argc -- CM */ -#define C_GC_OFFSET 4 - #define RELOC_H "elf64_loongarch64_reloc.h" #define SPECIAL_RELOC_H "elf64_loongarch64_reloc_special.h" /* #define MAX_CODE_ADDRESS (1L<<31)/\*large memory model broken gcc 4.8*\/ */ diff --git a/h/pool.h b/h/pool.h index bdb7e4b5..4f0ee91c 100644 --- a/h/pool.h +++ b/h/pool.h @@ -63,7 +63,6 @@ open_pool(void) { if (pool==-1) { - struct stat ss; massert(!lstat(multiprocess_memory_pool,&ss)); massert(S_ISDIR(ss.st_mode)); diff --git a/h/powerpc-linux.h b/h/powerpc-linux.h index 8355c0db..8896ffc1 100644 --- a/h/powerpc-linux.h +++ b/h/powerpc-linux.h @@ -21,5 +21,4 @@ #define SPECIAL_RELOC_H "elf64_ppcle_reloc_special.h" #endif #define OUTPUT_MACH bfd_mach_ppc64 -#define C_GC_OFFSET 4 #endif diff --git a/h/protoize.h b/h/protoize.h index 4f314804..69569f40 100644 --- a/h/protoize.h +++ b/h/protoize.h @@ -1671,6 +1671,6 @@ object quick_call_function_vec(object,ufixnum,object *); int msbrk_initialized(void); void *mdlopen(const char *,int); void set_global_env_defaults(void); -void disable_aslr(int,char **,char **); +void maybe_disable_aslr(int,char **,char **); void set_leak_malloc_on(void); void set_leak_malloc_off(void); diff --git a/h/riscv64-linux.h b/h/riscv64-linux.h index 3fe9384d..5f184628 100644 --- a/h/riscv64-linux.h +++ b/h/riscv64-linux.h @@ -2,9 +2,6 @@ #define SGC -/* Apparently stack pointers can be 4 byte aligned, at least &argc -- CM */ -#define C_GC_OFFSET 4 - #define RELOC_H "elf64_riscv64_reloc.h" /* #define MAX_CODE_ADDRESS (1L<<31)/\*large memory model broken gcc 4.8*\/ */ diff --git a/h/s390-linux.h b/h/s390-linux.h index ea981ce5..21a8a11f 100755 --- a/h/s390-linux.h +++ b/h/s390-linux.h @@ -3,7 +3,6 @@ #define SGC #if SIZEOF_LONG == 8 -#define C_GC_OFFSET 4 #define RELOC_H "elf64_s390_reloc.h" #define SPECIAL_RELOC_H "elf64_sparc_reloc_special.h" #define OUTPUT_MACH bfd_mach_s390_64 diff --git a/h/sparc-linux.h b/h/sparc-linux.h index ad33a3bd..249d1015 100755 --- a/h/sparc-linux.h +++ b/h/sparc-linux.h @@ -14,8 +14,4 @@ #define SPECIAL_RELOC_H "elf64_sparc_reloc_special.h" #endif -/* #if SIZEOF_LONG == 8 */ -/* #define C_GC_OFFSET 4 */ -/* #endif */ - #define OUTPUT_MACH bfd_mach_sparc_v9 diff --git a/o/cmpaux.c b/o/cmpaux.c index 6828dfa8..922b6a3e 100644 --- a/o/cmpaux.c +++ b/o/cmpaux.c @@ -659,7 +659,6 @@ find_init_name1(char *s,unsigned len) { return find_init_string(tmp); #else - struct stat ss; char *tmp,*q; FILE *f; diff --git a/o/disable_aslr.c b/o/disable_aslr.c index 61046967..ccaad637 100644 --- a/o/disable_aslr.c +++ b/o/disable_aslr.c @@ -1,7 +1,5 @@ #include "include.h" -#ifdef DISABLE_ASLR - #if defined(__APPLE__) #include @@ -15,11 +13,16 @@ #endif void -disable_aslr(int argc, char **argv, char **envp) { +maybe_disable_aslr(int argc, char **argv, char **envp) { pid_t pid; posix_spawnattr_t attr; +#ifndef DISABLE_ASLR + if (!getenv("GCL_DISABLE_ASLR")) + return; +#endif + if (!_dyld_get_image_vmaddr_slide(0)) { return; } @@ -88,11 +91,16 @@ reexec(int argc, char **argv, char **envp) { #include void -disable_aslr(int argc, char **argv, char **envp) { +maybe_disable_aslr(int argc, char **argv, char **envp) { long pers; long flag = ADDR_NO_RANDOMIZE|(sizeof(flag)==4 ? ADDR_COMPAT_LAYOUT : 0); +#ifndef DISABLE_ASLR + if (!getenv("GCL_DISABLE_ASLR")) + return; +#endif + massert((pers=personality(-1))!=-1); /*READ_IMPLIES_EXEC is for selinux, but selinux will reset it in the child*/ @@ -114,11 +122,16 @@ disable_aslr(int argc, char **argv, char **envp) { #include void -disable_aslr(int argc, char **argv, char **envp) { +maybe_disable_aslr(int argc, char **argv, char **envp) { const int cctl=PROC_ASLR_FORCE_DISABLE; int stat,ctl=cctl; +#ifndef DISABLE_ASLR + if (!getenv("GCL_DISABLE_ASLR")) + return; +#endif + massert(procctl(P_PID, 0, PROC_ASLR_STATUS, &stat) != -1); if ((stat&cctl)!=cctl && !getenv("GCL_UNRANDOMIZE")) { @@ -136,12 +149,10 @@ disable_aslr(int argc, char **argv, char **envp) { #else /*Unneeded on Hurd, cygwin/mingw via coff header flag*/ void -disable_aslr(int argc, char **argv, char **envp) { +maybe_disable_aslr(int argc, char **argv, char **envp) { return; } #endif #endif - -#endif diff --git a/o/file.d b/o/file.d index c1f9f9f8..acc5ec5f 100644 --- a/o/file.d +++ b/o/file.d @@ -257,7 +257,6 @@ open_stream(object fn,enum smmode smm, object if_exists, object if_does_not_exis if (!(fp=*FN1=='|' ? popen(FN1+1,"r") : fopen_not_dir(FN1,"r")) && sSAallow_gzipped_fileA->s.s_dbind!=Cnil) { - struct stat ss; massert(snprintf(FN2,sizeof(FN2),"%s.gz",FN1)>0); if (!stat(FN2,&ss)) { diff --git a/o/gprof.c b/o/gprof.c index ecf37368..399881d6 100644 --- a/o/gprof.c +++ b/o/gprof.c @@ -1,9 +1,21 @@ +#include + #include "include.h" #include "page.h" #include "ptable.h" - static unsigned long gprof_on; +static void (*real_mcount)(void); + +void __attribute__((no_instrument_function)) +mcount(void) { + + if (__builtin_expect(!gprof_on,1)) + return; + + real_mcount(); + +} /*all but this stub to be written in the future provided*/ #if defined(__APPLE__) @@ -44,6 +56,8 @@ DEFUN("MONSTARTUP",object,fSmonstartup,SI,2,2,NONE,OI,IO,OO,OO,(ufixnum start,uf return Cnil; writable_malloc_wrap(my_monstartup,int,start,end); + if (__builtin_expect(!real_mcount,0)) + massert(real_mcount=dlsym(RTLD_NEXT,"mcount")); gprof_on=1; return Ct; @@ -54,6 +68,7 @@ void gprof_cleanup(void) { FFN(fSmcleanup)(); + real_mcount=NULL; } diff --git a/o/hash.d b/o/hash.d index d3d8c41b..616d9474 100644 --- a/o/hash.d +++ b/o/hash.d @@ -79,7 +79,7 @@ static ufixnum ufixhash(ufixnum g) { ufixnum i,h; for (h=i=0;i>=CHAR_SIZE,i++) - h^=rtb[g&MASK(CHAR_SIZE)]; + h^=rtb[(g+i)&MASK(CHAR_SIZE)]; return h; } @@ -200,11 +200,11 @@ BEGIN: for (;u>s; - if (u>s; - if (ud_type #else #define get_d_type(e,s) \ - ({struct stat ss;\ - massert(snprintf(FN1,sizeof(FN1),"%-*.*s%s",s->st.st_fillp,s->st.st_fillp,s->st.st_self,e->d_name)>=0);\ + ({massert(snprintf(FN1,sizeof(FN1),"%-*.*s%s",s->st.st_fillp,s->st.st_fillp,s->st.st_self,e->d_name)>=0);\ lstat(FN1,&ss);S_ISDIR(ss.st_mode) ? DT_DIR : DT_REG;}) #endif @@ -517,7 +507,6 @@ get_mmap_flags(FILE *fp,void **ve,int flags) { int n; void *v1; - struct stat ss; massert((n=fileno(fp))>2); massert(!fstat(n,&ss)); diff --git a/unixport/sys.c b/unixport/sys.c index 260607c1..be38b6fc 100644 --- a/unixport/sys.c +++ b/unixport/sys.c @@ -23,8 +23,6 @@ static void ar_init_fn(void (fn)(void),const char *s) { - struct stat ss; - if (stat(s,&ss)) { char *sysd=getenv("GCL_SYSDIR"); -- 2.30.2